import axios from '@/util'; 

import type {
  RouteDto,
  MenuEntity,
} from './typings';



/**
 * 获取app 所有路由 GET /api/perm/all
 */
export async function get_api_perm_all (
  options?: Record<string, any>,
): Promise<RouteDto> {
  return axios({
    method: 'GET',
    url: `/api/perm/all`,
    ...(options || {}),
  })
}

/**
 * 获取用户权限所有接口路由列表 GET /api/perm/user
 */
export async function get_api_perm_user (
  options?: Record<string, any>,
): Promise<RouteDto> {
  return axios({
    method: 'GET',
    url: `/api/perm/user`,
    ...(options || {}),
  })
}

/**
 * 用户权限 GET /api/perm/menu
 */
export async function get_api_perm_menu (
  options?: Record<string, any>,
): Promise<MenuEntity> {
  return axios({
    method: 'GET',
    url: `/api/perm/menu`,
    ...(options || {}),
  })
}
